Skip to content

Fix root build order and add workspace typecheck to CI - #29

Merged
rgarcia merged 1 commit into
mainfrom
hypeship/fix-build-order-typecheck
Jun 12, 2026
Merged

Fix root build order and add workspace typecheck to CI#29
rgarcia merged 1 commit into
mainfrom
hypeship/fix-build-order-typecheck

Conversation

@rgarcia

@rgarcia rgarcia commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

npm ci && npm run build on a fresh clone of main fails, and on a previously built checkout it fails differently. Root cause: the root build and typecheck scripts run tsc -b before @onkernel/cua-agent's tsdown build, so packages/cli is type-checked against packages/agent/dist that either doesn't exist yet (fresh clone → TS2307 cascade) or is stale from an older pi-agent-core build (→ phantom errors like missing getModel/model_update, even though pi-agent-core 0.79.1 has those APIs and the cli code is correct).

CI never caught this because no job runs the root build or type-checks packages/clicli-unit only runs vitest, which transpiles without type-checking.

  • Reorder root build and typecheck so the cua-ai and cua-agent dist artifacts are built before tsc -b.
  • Add a npx tsc -b step to the cli-unit job (after the ai/agent builds), closing the type-check gap for the whole workspace.
  • Prune orphaned @mariozechner/*@0.67 lockfile entries and their unreferenced transitive deps (411 deleted lines, no version changes) — leftovers from the pi 0.79 migration.

Test plan

  • Clean slate (tsc -b --clean, all dist/ removed, npm ci): npm run build passes end to end, including the ptywright native build with zig 0.15.2
  • npx tsc -b exits 0
  • PTYWRIGHT_REQUIRED=1 npm test --workspace @onkernel/cua-cli — 33/33
  • npm test --workspace @onkernel/cua-ai — 88/88; npm test --workspace @onkernel/cua-agent (excl. live) — 28/28
  • CI green on this PR (the new typecheck step runs in cli-unit)

🤖 Generated with Claude Code


Note

Low Risk
Script ordering and CI guardrails plus lockfile pruning; no runtime behavior or API changes.

Overview
Fixes fresh and stale clone build failures by building @onkernel/cua-ai and @onkernel/cua-agent before root tsc -b, so packages/cli type-checks against current packages/agent/dist instead of missing or outdated artifacts.

Root build and typecheck scripts now follow that order. The cli-unit CI job adds an explicit npx tsc -b step after the ai/agent workspace builds (before ptywright native build and vitest), so the monorepo project references are enforced in CI—not only via tests that transpile without full type-checking.

package-lock.json drops orphaned @mariozechner/*@0.67 trees and unreferenced transitive deps left from the pi 0.79 migration (lockfile cleanup only, no intentional version bumps).

Reviewed by Cursor Bugbot for commit a52c9d3. Bugbot is set up for automated code reviews on this repo. Configure here.

The root build and typecheck scripts ran tsc -b before @onkernel/cua-agent's
tsdown build, so packages/cli was type-checked against a missing (fresh
clone) or stale (previously built checkout) dist/index.d.ts. Reorder the
scripts so workspace dist artifacts exist before tsc -b runs, and add a
typecheck step to the cli-unit CI job, which previously never type-checked
packages/cli (vitest does not type-check).

Also prune orphaned @mariozechner/* 0.67 entries and their unreferenced
transitive deps from package-lock.json (leftover from the pi 0.79 migration).
@rgarcia
rgarcia marked this pull request as ready for review June 12, 2026 18:15
@rgarcia
rgarcia merged commit 16ac531 into main Jun 12, 2026
5 checks passed
@rgarcia
rgarcia deleted the hypeship/fix-build-order-typecheck branch June 12, 2026 18:15
@firetiger-agent

Copy link
Copy Markdown

Created a monitoring plan for this PR.

What this PR does: Fixes the root workspace build and typecheck scripts so they compile dependencies in the correct order, and closes a type-checking gap in CI by adding a npx tsc -b step to the cli-unit job. This is a developer-tooling change with no user-facing effect.

Intended effect: No production telemetry signal exists for this change. The measurable outcome is purely within CI: the cli-unit job now runs npx tsc -b after building cua-ai and cua-agent, and the root npm run build and npm run typecheck commands succeed on a clean checkout. The CI run for this PR's HEAD SHA (a52c9d3) completed with conclusion: success at 2026-06-12T18:07Z, confirming the fix works end-to-end.

Risks:

  • Typecheck surface expansion — the new npx tsc -b step now type-checks packages/cli against live dist/ artifacts; if a future PR introduces a type error in packages/cli that previously went undetected, CI will fail. Alert if cli-unit job starts failing with TS2307 or similar TypeScript errors after this merges.
  • Increased CI job duration — adding a full tsc -b compile to cli-unit adds wall-clock time; alert if cli-unit exceeds the 15-minute job timeout (currently well below based on passing run).

Status updates will be posted automatically on this PR as monitoring progresses.

View monitor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant